import { createApp } from 'vue'
//全局样式
import '@/style.css'
import App from './App.vue'
//路由
import router  from './router'
//datav组件
import DataVVue3 from '@kjgl77/datav-vue3'
//andt组件库
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
//阿里巴巴矢量icon图标样式
import "./assets/font/iconfont.css"
//自定义全局组件
import WsIcon from '@/components/WsIcon.vue'
import WsSvgIcon from '@/components/WsSvgIcon.vue'
import WsAuthority from '@/components/WsAuthority.vue'

// 文件分片上传
import uploader from 'vue-simple-uploader';
import 'vue-simple-uploader/dist/style.css';
const app = createApp(App);
app.component('WsIcon',WsIcon)
app.component('WsSvgIcon',WsSvgIcon)
app.component('WsAuthority',WsAuthority)
//自定义指令
import permission from '@/directives/permission'
app.use(permission)



//pinia全局数据共享
import { createPinia } from 'pinia'
//缓存插件
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

import moment from 'moment'
app.config.globalProperties.$moment=moment;
app.config.globalProperties.$formatDate = (value) => {
    if (!value) return '';
    return moment(value).format('YYYY-DD-MM HH:mm:ss');
};



app.use(uploader)
app.use(Antd)
app.use(DataVVue3)
app.use(pinia)
app.use(router).mount('#app')
